package com.example.mybatisplusdemo.model.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 存储商品详情
 * </p>
 *
 * @author lqj
 * @since 2025-06-24
 */
@TableName("product")
@ApiModel(value = "Product对象", description = "存储商品详情")
public class Product implements Serializable {

    private static final long serialVersionUID = 1L;
    public Long pointsPrice;

    public Long getPointsPrice() {
        return pointsPrice;
    }

    public void setPointsPrice(Long pointsPrice) {
        this.pointsPrice = pointsPrice;
    }

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "订单主表_主键")
    @TableField("order_id")
    private Long orderId;

    @ApiModelProperty(value = "商品分类_主键")
    @TableField("category_id")
    private Long categoryId;

    @ApiModelProperty(value = "外键")
    @TableField("fk_self")
    private Long fkSelf;

    @ApiModelProperty(value = "积分商城_主键")
    @TableField("points_id")
    private Long pointsId;

    @ApiModelProperty(value = "商品名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "商品主图")
    @TableField("main_image")
    private String mainImage;

    @ApiModelProperty(value = "商品颜色")
    @TableField("product_color")
    private String productColor;

    @ApiModelProperty(value = "商品尺寸")
    @TableField("product_size")
    private String productSize;

    @ApiModelProperty(value = "销售价格")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty(value = "折扣率")
    @TableField("discount_rate")
    private BigDecimal discountRate;

    @ApiModelProperty(value = "浏览次数")
    @TableField("view_count")
    private Long viewCount;

    @ApiModelProperty(value = "商品产地")
    @TableField("origin")
    private String origin;

    @ApiModelProperty(value = "品牌名称")
    @TableField("brand")
    private String brand;

    @ApiModelProperty(value = "是否参与团购")
    @TableField("is_group_buy")
    private Boolean groupBuy;

    @ApiModelProperty(value = "是否在积分商城")
    @TableField("is_points_mall")
    private Boolean pointsMall;

    @ApiModelProperty(value = "逻辑删除")
    @TableField("is_deleted")
    @TableLogic
    private Boolean deleted;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "商品库存")
    @TableField("inventory")
    private Long inventory;

    public Long getId() {
        return id;
    }

    public Product setId(Long id) {
        this.id = id;
        return this;
    }

    public Long getOrderId() {
        return orderId;
    }

    public Product setOrderId(Long orderId) {
        this.orderId = orderId;
        return this;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public Product setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
        return this;
    }

    public Long getFkSelf() {
        return fkSelf;
    }

    public Product setFkSelf(Long fkSelf) {
        this.fkSelf = fkSelf;
        return this;
    }

    public Long getPointsId() {
        return pointsId;
    }

    public Product setPointsId(Long pointsId) {
        this.pointsId = pointsId;
        return this;
    }

    public String getName() {
        return name;
    }

    public Product setName(String name) {
        this.name = name;
        return this;
    }

    public String getMainImage() {
        return mainImage;
    }

    public Product setMainImage(String mainImage) {
        this.mainImage = mainImage;
        return this;
    }

    public String getProductColor() {
        return productColor;
    }

    public Product setProductColor(String productColor) {
        this.productColor = productColor;
        return this;
    }

    public String getProductSize() {
        return productSize;
    }

    public Product setProductSize(String productSize) {
        this.productSize = productSize;
        return this;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public Product setPrice(BigDecimal price) {
        this.price = price;
        return this;
    }

    public BigDecimal getDiscountRate() {
        return discountRate;
    }

    public Product setDiscountRate(BigDecimal discountRate) {
        this.discountRate = discountRate;
        return this;
    }

    public Long getViewCount() {
        return viewCount;
    }

    public Product setViewCount(Long viewCount) {
        this.viewCount = viewCount;
        return this;
    }

    public String getOrigin() {
        return origin;
    }

    public Product setOrigin(String origin) {
        this.origin = origin;
        return this;
    }

    public String getBrand() {
        return brand;
    }

    public Product setBrand(String brand) {
        this.brand = brand;
        return this;
    }

    public Boolean getGroupBuy() {
        return groupBuy;
    }

    public Product setGroupBuy(Boolean groupBuy) {
        this.groupBuy = groupBuy;
        return this;
    }

    public Boolean getPointsMall() {
        return pointsMall;
    }

    public Product setPointsMall(Boolean pointsMall) {
        this.pointsMall = pointsMall;
        return this;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public Product setDeleted(Boolean deleted) {
        this.deleted = deleted;
        return this;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public Product setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
        return this;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public Product setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public Long getInventory() {
        return inventory;
    }

    public Product setInventory(Long inventory) {
        this.inventory = inventory;
        return this;
    }

//    private Integer pointsPrice;
//
//    public Integer getPointsPrice() {
//        return pointsPrice;
//    }
//    public void setPointsPrice(Integer pointsPrice) {
//        this.pointsPrice = pointsPrice;
//    }

    @Override
    public String toString() {
        return "Product{" +
                "id=" + id +
                ", orderId=" + orderId +
                ", categoryId=" + categoryId +
                ", fkSelf=" + fkSelf +
                ", pointsId=" + pointsId +
                ", name=" + name +
                ", mainImage=" + mainImage +
                ", productColor=" + productColor +
                ", productSize=" + productSize +
                ", price=" + price +
                ", discountRate=" + discountRate +
                ", viewCount=" + viewCount +
                ", origin=" + origin +
                ", brand=" + brand +
                ", groupBuy=" + groupBuy +
                ", pointsMall=" + pointsMall +
                ", deleted=" + deleted +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", inventory=" + inventory +
                "}";
    }


}
